package java2_unit3_1013.pet;

import java.util.Scanner;

public class PetTest {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scanner = new Scanner(System.in);
		boolean flag=true;
		while(flag){
			System.out.println("宠物种类：\n1.狗\t2.猫");
			System.out.println("请选择：");
			int choice = scanner.nextInt();
			switch (choice ) {
			case 1:
				Dog dog = new  Dog();
				System.out.print("请输入昵称：");
				dog.setName(scanner.next());
				System.out.print("请输入宠物性别(1.雄\t2.雌)：");
				int sexInt=scanner.nextInt();
				dog.setSex(sexInt==1?"雄":"雌");
				System.out.print("请输入宠物的健康值(1-100之间)：");
				dog.setHealth(scanner.nextInt());
				System.out.print("请输入宠物与主人的亲密度(1-10之间)：");
				dog.setLove(scanner.nextInt());
				dog.show();
				flag=false;
				break;
			case 2:
				Cat cat= new  Cat();
				System.out.print("请输入昵称：");
				cat.setName(scanner.next());
				System.out.print("请输入宠物性别(1.雄\t2.雌)：");
				int sexInt2=scanner.nextInt();
				cat.setSex(sexInt2==1?"雄":"雌");
				System.out.print("请输入宠物的健康值(1-100之间)：");
				cat.setHealth(scanner.nextInt());
				System.out.print("请输入宠物与主人的亲密度(1-10之间)：");
				cat.setLazy(scanner.nextInt());
				cat.show();
				flag=false;
				break;
			default:
				System.out.println("输入有误,请重新输入！");
				break;
			}
		}
	}
}
